import java.util.Random;
import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        /*
        int i = 1;
        while (i<10){
            if(i==5){
                break;
            }
            System.out.println(i);
            i++;
        }

         */

        /*
        //写一个代码,找到1~100之间所有能被5和3整除的数字,要求:用break或者continue
        int i = 1;
        int count = 0;
        System.out.println("能被整除的数有:");
        while (i<=100){
            if(i%5==0&&i%3==0){
                count++;
                System.out.print(i+" ");
                i++;
                continue;
            }
            i++;
        }
        System.out.println("\n一共有"+count+"数个能被5整除");

         */

        /*猜数
        Random r = new Random();
        int a1 = r.nextInt(100);
        System.out.println("输入数字:");
        Scanner sc = new Scanner(System.in);
        for (int i = 0; ; i++) {
            int a2 = sc.nextInt();
            if(a2==a1){
                System.out.println("猜对了");
                break;
            } else if (a2>a1) {
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
        }

         */
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字判断是否为偶数:");
        int i = sc.nextInt();
        Test(i);
    }
    public static void Test(int i){
        if(i%2==0){
            System.out.println(i+"是偶数");
        }else{
            System.out.println(i+"是奇数");
        }
    }
}
